package com.xingfly.model;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 点赞
 * 包含了 用户和 喜欢的对象类型 如：某个post
 * Created by SuperS on 2016/12/7.
 */
@Entity
@Table(name = "xf_like")
public class Like extends BaseModel {
    @OneToOne
    @JoinColumn(name = "user_id")
    private User user;

    //喜欢的对象类型
    private int objectType;
    //喜欢的对象ID
    private Long objectId;

    public Like(User user, int objectType, Long objectId) {
        super();
        this.user = user;
        this.objectType = objectType;
        this.objectId = objectId;
    }

    public Like() {
    }


    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getObjectType() {
        return objectType;
    }

    public void setObjectType(int objectType) {
        this.objectType = objectType;
    }

    public Long getObjectId() {
        return objectId;
    }

    public void setObjectId(Long objectId) {
        this.objectId = objectId;
    }
}
